<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Producto
 *
 * @author JosLap
 */
class Producto {
    private $nombre;
    private $descr;
    private $precio;
    private $imagen;
    private $disp;
    private $id;
    private $tipo;
    
    public function __construct($nombre, $descr, $precio, $imagen, $disp, $tipo, $id = '') {
        $this->nombre = $nombre;
        $this->descr = $descr;
        $this->precio = $precio;
        $this->disp = $disp;
        $this->imagen = $imagen;
        $this->id = $id;
        $this->tipo = $tipo;
    }
    
    public function toArray() {
        $array = array();
        $array['Id'] = $this->id;
        $array['Nombre'] = $this->nombre;
        $array['Descripcion'] = $this->descr;
        $array['Precio'] = $this->precio;
        $array['Tipo'] = $this->tipo;
        $array['Disponibilidad'] = $this->disp;
        $array['Imagen'] = $this->imagen;
        return $array;
    }




    public function getNombre(){
        return $this->nombre;
    }
    
    public function isDisponible(){
        $this->disp=='1'?$isDisp = TRUE:$isDisp = FALSE;
        return $isDisp;
    }
    public function getDisponible(){
        return $this->disp;
    }
    public function getDescr(){
        return $this->descr;
    }
    public function getImagen(){
        return $this->imagen;
    }
    public function getPrecio(){
        return $this->precio;
    }
    
    public function getTipo(){
        return $this->tipo;
    }
    
    public function getId(){
        return $this->id;
    }
}

?>
